#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include "ConfProto.h"
#include "tblutil.h"
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\HDT.h>

const char*HDTName = "HDT.dat";

static HDT_REC srHDTRec;

static int recordNum;
int	inLoadHDTRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(HDT_FILENAME, SIZE_HDT_REC, inRecNumber, (char *) &srHDTRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetHDTRec(void)
{
	return &srHDTRec;

}

int	inSaveHDTRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(HDT_FILENAME, SIZE_HDT_REC, inRecNumber, (char *) &srHDTRec);

	return inRet;
}

int	inGetHDTRecNumber (void)
{
	return recordNum;
}

int	inUpdateHDTRec (void)
{
	int inRet;

	inRet = inSaveConfRec(HDT_FILENAME, SIZE_HDT_REC, recordNum, (char *) &srHDTRec);

	return inRet;
}

void	vdResetHDTRec (void)
{
	memset((void*)&srHDTRec, 0, REC_SIZEOF(srHDTRec));
}

short shGetHostGroupRef(void)
{
	return srHDTRec.shHostGroupRef;
}

void vdSetHostGroupRef(short shHostGroupRef)
{
	srHDTRec.shHostGroupRef = shHostGroupRef;
}

char* szGetHostName(void)
{
	return srHDTRec.szHostName;
}

void vdSetHostName(const char* szHostName)
{
	strNumCopy(srHDTRec.szHostName, szHostName, sizeof(((HDT_REC*)NULL)->szHostName)-1);
}

char* szGetHostFileName(void)
{
	return srHDTRec.szHostFileName;
}

void vdSetHostFileName(const char* szHostFileName)
{
	strNumCopy(srHDTRec.szHostFileName, szHostFileName, sizeof(((HDT_REC*)NULL)->szHostFileName)-1);
}

char* szGetTRTFileName(void)
{
	return srHDTRec.szTRTFileName;
}

void vdSetTRTFileName(const char* szTRTFileName)
{
	strNumCopy(srHDTRec.szTRTFileName, szTRTFileName, sizeof(((HDT_REC*)NULL)->szTRTFileName)-1);
}

char* szGetPETFileName(void)
{
	return srHDTRec.szPETFileName;
}

void vdSetPETFileName(const char* szPETFileName)
{
	strNumCopy(srHDTRec.szPETFileName, szPETFileName, sizeof(((HDT_REC*)NULL)->szPETFileName)-1);
}

char* szGetLGOFileName(void)
{
	return srHDTRec.szLGOFileName;
}

void vdSetLGOFileName(const char* szLGOFileName)
{
	strNumCopy(srHDTRec.szLGOFileName, szLGOFileName, sizeof(((HDT_REC*)NULL)->szLGOFileName)-1);
}

char* szGetAmountFormat(void)
{
	return srHDTRec.szAmountFormat;
}

void vdSetAmountFormat(const char* szAmountFormat)
{
	strNumCopy(srHDTRec.szAmountFormat, szAmountFormat, sizeof(((HDT_REC*)NULL)->szAmountFormat)-1);
}

short shGetCommLinkType(void)
{
	return srHDTRec.shCommLinkType;
}

void vdSetCommLinkType(short shCommLinkType)
{
	srHDTRec.shCommLinkType = shCommLinkType;
}

short shGetSettleCommLinkType(void)
{
	return srHDTRec.shSettleCommLinkType;
}

void vdSetSettleCommLinkType(short shSettleCommLinkType)
{
	srHDTRec.shSettleCommLinkType = shSettleCommLinkType;
}

short shGetPacketType(void)
{
	return srHDTRec.shPacketType;
}

void vdSetPacketType(short shPacketType)
{
	srHDTRec.shPacketType = shPacketType;
}

short shGetTransProtocol(void)
{
	return srHDTRec.shTransProtocol;
}

void vdSetTransProtocol(short shTransProtocol)
{
	srHDTRec.shTransProtocol = shTransProtocol;
}

short shGetSettleProtocol(void)
{
	return srHDTRec.shSettleProtocol;
}

void vdSetSettleProtocol(short shSettleProtocol)
{
	srHDTRec.shSettleProtocol = shSettleProtocol;
}

short inGetNumAdv(void)
{
	return srHDTRec.inNumAdv;
}

void vdSetNumAdv(short inNumAdv)
{
	srHDTRec.inNumAdv = inNumAdv;
}

short inGetCurrencyIdx(void)
{
	return srHDTRec.inCurrencyIdx;
}

void vdSetCurrencyIdx(short inCurrencyIdx)
{
	srHDTRec.inCurrencyIdx = inCurrencyIdx;
}

short inGetBatchIndex(void)
{
	return srHDTRec.inBatchIndex;
}

void vdSetBatchIndex(short inBatchIndex)
{
	srHDTRec.inBatchIndex = inBatchIndex;
}

short inGetFraudControl(void)
{
	return srHDTRec.inFraudControl;
}

void vdSetFraudControl(short inFraudControl)
{
	srHDTRec.inFraudControl = inFraudControl;
}

short inGetImprintCardConfirm(void)
{
	return srHDTRec.inImprintCardConfirm;
}

void vdSetImprintCardConfirm(short inImprintCardConfirm)
{
	srHDTRec.inImprintCardConfirm = inImprintCardConfirm;
}

short inGetSettlementType(void)
{
	return srHDTRec.inSettlementType;
}

void vdSetSettlementType(short inSettlementType)
{
	srHDTRec.inSettlementType = inSettlementType;
}

char chGetBatchUploadSchemeForVoid(void)
{
	return srHDTRec.chBatchUploadSchemeForVoid;
}

void vdSetBatchUploadSchemeForVoid(char chBatchUploadSchemeForVoid)
{
	srHDTRec.chBatchUploadSchemeForVoid = chBatchUploadSchemeForVoid;
}

char chGetBatchUploadSchemeForAdjust(void)
{
	return srHDTRec.chBatchUploadSchemeForAdjust;
}

void vdSetBatchUploadSchemeForAdjust(char chBatchUploadSchemeForAdjust)
{
	srHDTRec.chBatchUploadSchemeForAdjust = chBatchUploadSchemeForAdjust;
}

short inGetHDTCustomInt(void)
{
	return srHDTRec.inHDTCustomInt;
}

void vdSetHDTCustomInt(short inHDTCustomInt)
{
	srHDTRec.inHDTCustomInt = inHDTCustomInt;
}

short inGetCounterIndex(void)
{
	return srHDTRec.inCounterIndex;
}

void vdSetCounterIndex(short inCounterIndex)
{
	srHDTRec.inCounterIndex = inCounterIndex;
}

short shGetCommunicationIndex(void)
{
	return srHDTRec.shCommunicationIndex;
}

void vdSetCommunicationIndex(short shCommunicationIndex)
{
	srHDTRec.shCommunicationIndex = shCommunicationIndex;
}

short inGetSTANSize(void)
{
	return srHDTRec.inSTANSize;
}

void vdSetSTANSize(short inSTANSize)
{
	srHDTRec.inSTANSize = inSTANSize;
}

short inGetMonth(void)
{
	return srHDTRec.inMonth;
}

void vdSetMonth(short inMonth)
{
	srHDTRec.inMonth = inMonth;
}

short inGetHost(void)
{
	return srHDTRec.inHost;
}

void vdSetHost(short inHost)
{
	srHDTRec.inHost = inHost;
}

short shGetHostInvNumSize(void)
{
	return srHDTRec.shHostInvNumSize;
}

void vdSetHostInvNumSize(short shHostInvNumSize)
{
	srHDTRec.shHostInvNumSize = shHostInvNumSize;
}

VS_BOOL fGetHDTCustomBit1(void)
{
	return srHDTRec.fHDTCustomBit1;
}

void vdSetHDTCustomBit1(VS_BOOL fHDTCustomBit1)
{
	srHDTRec.fHDTCustomBit1 = fHDTCustomBit1;
}

VS_BOOL fGetHDTCustomBit2(void)
{
	return srHDTRec.fHDTCustomBit2;
}

void vdSetHDTCustomBit2(VS_BOOL fHDTCustomBit2)
{
	srHDTRec.fHDTCustomBit2 = fHDTCustomBit2;
}

VS_BOOL fGetHDTCustomBit3(void)
{
	return srHDTRec.fHDTCustomBit3;
}

void vdSetHDTCustomBit3(VS_BOOL fHDTCustomBit3)
{
	srHDTRec.fHDTCustomBit3 = fHDTCustomBit3;
}

VS_BOOL fGetHDTCustomBit4(void)
{
	return srHDTRec.fHDTCustomBit4;
}

void vdSetHDTCustomBit4(VS_BOOL fHDTCustomBit4)
{
	srHDTRec.fHDTCustomBit4 = fHDTCustomBit4;
}

VS_BOOL fGetIndependentBatch(void)
{
	return srHDTRec.fIndependentBatch;
}

void vdSetIndependentBatch(VS_BOOL fIndependentBatch)
{
	srHDTRec.fIndependentBatch = fIndependentBatch;
}

VS_BOOL fGetBatchUploadVoidAsOrigTx(void)
{
	return srHDTRec.fBatchUploadVoidAsOrigTx;
}

void vdSetBatchUploadVoidAsOrigTx(VS_BOOL fBatchUploadVoidAsOrigTx)
{
	srHDTRec.fBatchUploadVoidAsOrigTx = fBatchUploadVoidAsOrigTx;
}

VS_BOOL fGetPrintBatNum(void)
{
	return srHDTRec.fPrintBatNum;
}

void vdSetPrintBatNum(VS_BOOL fPrintBatNum)
{
	srHDTRec.fPrintBatNum = fPrintBatNum;
}

VS_BOOL fGetCheckHost(void)
{
	return srHDTRec.fCheckHost;
}

void vdSetCheckHost(VS_BOOL fCheckHost)
{
	srHDTRec.fCheckHost = fCheckHost;
}

VS_BOOL fGetCredDebHost(void)
{
	return srHDTRec.fCredDebHost;
}

void vdSetCredDebHost(VS_BOOL fCredDebHost)
{
	srHDTRec.fCredDebHost = fCredDebHost;
}

VS_BOOL fGetCreditPredial(void)
{
	return srHDTRec.fCreditPredial;
}

void vdSetCreditPredial(VS_BOOL fCreditPredial)
{
	srHDTRec.fCreditPredial = fCreditPredial;
}

VS_BOOL fGetAllowMultiCurrency(void)
{
	return srHDTRec.fAllowMultiCurrency;
}

void vdSetAllowMultiCurrency(VS_BOOL fAllowMultiCurrency)
{
	srHDTRec.fAllowMultiCurrency = fAllowMultiCurrency;
}

VS_BOOL fGetImamRefundApprCode(void)
{
	return srHDTRec.fImamRefundApprCode;
}

void vdSetImamRefundApprCode(VS_BOOL fImamRefundApprCode)
{
	srHDTRec.fImamRefundApprCode = fImamRefundApprCode;
}

VS_BOOL fGetImamMacField(void)
{
	return srHDTRec.fImamMacField;
}

void vdSetImamMacField(VS_BOOL fImamMacField)
{
	srHDTRec.fImamMacField = fImamMacField;
}

VS_BOOL fGetImamEchoTest(void)
{
	return srHDTRec.fImamEchoTest;
}

void vdSetImamEchoTest(VS_BOOL fImamEchoTest)
{
	srHDTRec.fImamEchoTest = fImamEchoTest;
}

VS_BOOL fGetImamNeedLogon(void)
{
	return srHDTRec.fImamNeedLogon;
}

void vdSetImamNeedLogon(VS_BOOL fImamNeedLogon)
{
	srHDTRec.fImamNeedLogon = fImamNeedLogon;
}

VS_BOOL fGetImamLogonStatus(void)
{
	return srHDTRec.fImamLogonStatus;
}

void vdSetImamLogonStatus(VS_BOOL fImamLogonStatus)
{
	srHDTRec.fImamLogonStatus = fImamLogonStatus;
}

VS_BOOL fGetImamVoidSwipePin(void)
{
	return srHDTRec.fImamVoidSwipePin;
}

void vdSetImamVoidSwipePin(VS_BOOL fImamVoidSwipePin)
{
	srHDTRec.fImamVoidSwipePin = fImamVoidSwipePin;
}

VS_BOOL fGetImamEmvHost(void)
{
	return srHDTRec.fImamEmvHost;
}

void vdSetImamEmvHost(VS_BOOL fImamEmvHost)
{
	srHDTRec.fImamEmvHost = fImamEmvHost;
}

VS_BOOL fGetImamGuestHost(void)
{
	return srHDTRec.fImamGuestHost;
}

void vdSetImamGuestHost(VS_BOOL fImamGuestHost)
{
	srHDTRec.fImamGuestHost = fImamGuestHost;
}

VS_BOOL fGetImamHostPiggyBack(void)
{
	return srHDTRec.fImamHostPiggyBack;
}

void vdSetImamHostPiggyBack(VS_BOOL fImamHostPiggyBack)
{
	srHDTRec.fImamHostPiggyBack = fImamHostPiggyBack;
}

VS_BOOL fGetImamHostOffineRefund(void)
{
	return srHDTRec.fImamHostOffineRefund;
}

void vdSetImamHostOffineRefund(VS_BOOL fImamHostOffineRefund)
{
	srHDTRec.fImamHostOffineRefund = fImamHostOffineRefund;
}

VS_BOOL fGetImamHostOfflineVoid(void)
{
	return srHDTRec.fImamHostOfflineVoid;
}

void vdSetImamHostOfflineVoid(VS_BOOL fImamHostOfflineVoid)
{
	srHDTRec.fImamHostOfflineVoid = fImamHostOfflineVoid;
}

VS_BOOL fGetImamHostTrack1Req(void)
{
	return srHDTRec.fImamHostTrack1Req;
}

void vdSetImamHostTrack1Req(VS_BOOL fImamHostTrack1Req)
{
	srHDTRec.fImamHostTrack1Req = fImamHostTrack1Req;
}

